//
//  JGMainViewController.m
//  JGShowSidePageDemo
//
//  Created by mac on 15/11/2.
//  Copyright (c) 2015年 Free. All rights reserved.
//

#import "JGMainViewController.h"
#import "JGNavButton.h"
#import "JGSideHelper.h"
#import "UIButton+Category.h"

#import "JASidePanelController.h"
#import "UIViewController+JASidePanel.h"

@interface JGMainViewController ()

@end

@implementation JGMainViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.rightNavButtonPraDic =  @{@"NormalImage":@"nav_icon_list",@"HighlightImage":@"nav_icon_list_press"};
    }
    return self;
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    
}


- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title = @"Main";

}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
}

/**
 * 设置导航栏左边按钮
 */

-(JGNavButton *)leftBarButton
{
    JGNavButton *button = [JGNavButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 5, 45, 44);
    button.normalImage = [UIImage imageNamed:@"nav_icon_redact.png"];
    button.highlightedImage = [UIImage imageNamed:@"nav_icon_redact_press.png"];
    
    return button;
}

#pragma mark - 导航栏按钮点击方法
-(void)leftNavButtonClicked:(JGNavButton *)button
{
    [self.sidePanelController showLeftPanelAnimated:YES];
}

- (void)rightNavButtonClicked:(JGNavButton *)button
{
    [self.sidePanelController showRightPanelAnimated:YES];
}

@end
